package khai.spring.ioc;

import khai.spring.annotation.Autowired;
import khai.spring.annotation.Controller;
import khai.spring.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @author Khai Loon
 * @version 2017/4/17 0017 下午 3:24
 */
@Controller
@RequestMapping(value = "spring")
public class SpringController {

    @Autowired
    private SpringService springService;

    @RequestMapping(value = "init")
    public String init(HttpServletRequest request, HttpServletResponse response) throws IOException {
        System.out.println("SpringController 进入");
        response.getWriter().print("hello word");
        return springService.init();
    }


    @RequestMapping(value = "init1")
    public String init1(HttpServletRequest request, HttpServletResponse response) throws IOException {
        System.out.println("SpringController 进入");
        response.getWriter().print("hello word1");
        return springService.init();
    }
}
